<?php 
	class Proposal_management extends CI_Controller
		{
			
				function __construct()
					{
						parent::__construct();
						if(!$this->ion_auth->logged_in())
							{
								redirect('auth/login');
							}
						
						$this->load->helper('url');
						$this->load->model('user/category_tree_create');
						$this->load->model('user/proposal_plan_menu_model');
						$this->load->model('user/proposal_tree_menu_model');
					}
				
				function index()
					{
						exit('No direct script access allowed');
					}
					
				function add_category()
					{
						if(isset($id))
							{
								$user= $id;
							}
						else
							{
								$user=$this->session->userdata('user_id');		
							}
						$data['userid'] = $user;
						$page = $this->session->flashdata('page');
						$meta['page_title'] = "Proposal Category Add Menu";
						$meta['message'] = "Logged In Successfully";
						$this->load->view('common/header', $meta);
						$this->load->view('user/proposal_category_add_view');
						$this->load->view('common/footer');
					}

					function plan_menu()
						{
							if(isset($id))
								{
									$user= $id;
								}
							else
								{
									$user=$this->session->userdata('user_id');		
								}
							$data['userid'] = $user;
							$page = $this->session->flashdata('page');
							$meta['page_title'] = "Proposal Category Add Menu";
							$meta['message'] = "Logged In Successfully";
							$this->load->view('common/header', $meta);
							$this->load->view('user/proposal_plan_menu');
							$this->load->view('common/footer');
						}
					
					function tab_view()
					{
						$module_id = $this->input->get_post('module_id');
						$data['module_id'] = $module_id;
						$data['plan_details'] = $this->proposal_plan_menu_model->plan_data_generate($module_id);
						$this->load->view('user/tab_view',$data);	
					}
					
					function tree_view()
					{
						$data['tree_string'] = $this->proposal_tree_menu_model->service_menu_generate('',0);
						//$this->load->view('user/proposal_tree_menu',$data);	
					}
					
					function module_tree_view()
					{
						$category_id = $this->input->get_post('category_id');
						$data['tree_string'] = $this->proposal_tree_menu_model->modules_menu_generate($category_id);
						//$this->load->view('user/proposal_tree_menu',$data);	
					}
					
					function proposal_dynamic_tab()
						{
							$data['tab_id'] = $this->input->get_post('tab_id');
							//$this->proposal_plan_menu_model->plan_data_generate($tab_id);
							$this->load->view('user/proposal_dynamic_tab_view',$data);
						}			
		}
?>		